<include file="Public:header"/>
<input type="button" value="添加新文章" onclick="add()" style="padding:5px;"/>

<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="200">文章标题</td>
		<td class="title" width="80">添加时间</td>
		<td class="title" width="40">编辑</td>
		<td class="title" width="40">删除</td>
		<td class="title">　</td>
	</tr>
<volist name="tiaokuan" id="tiaokuan">
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="200" style="font-weight:bold">{$tiaokuan.title}</td>
		<td width="80" align="center">{$tiaokuan.time|date="Y-m-d",###}</td>
		<td width="40" align="center"><a href="javascript:;" onclick="edit({$tiaokuan.id})"><img src="__APP__/statics/add44.gif"></a></td>
		<td width="40" align="center"><a href="javascript:;" onclick="deletes({$tiaokuan.id})"><img alt="删除" src="__APP__/statics/icons/icon_delete.gif"></a></td>
		<td></td>
	</tr>
</volist>
</table>




<script src="__APP__/statics/webox/webox.js"></script>
<link href="__APP__/statics/webox/jquery-webox.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function add(){
		$.webox({
			height:465,
			width:950,
			bgvisibel:true,
			title:'添加新文章—购物条款',
			iframe:'__URL__/add_tiaokuan.html'
		});
}
function edit(t){
       var id=t;
		$.webox({
			height:465,
			width:950,
			bgvisibel:true,
			title:'修改文章—购物条款',
			iframe:'__URL__/tiaokuan/?action=edit&id='+id
		});
}
</script>

<script>
function deletes(t){
    var id=t;
	if(confirm('你确认删除此文章吗？')) {
       $.ajax({
	       type:"GET",
		   url:"__URL__/del",
		   dataType:"json",
		   data:{"type":'tk',"id":id},
		   success:function(data){
               if(data=='1'){
				   jSuccess("<strong>删除成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
			  }else{
			      jError("<strong>删除失败!请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }
		   }
	   })

	}
}
</script>

